package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.entity.Category;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @Author by 孙有泽
 * @Date 2025/2/28 10:11
 * @Description
 */
@Mapper
public interface CategoryMapper {
    @AutoFill(OperationType.INSERT)
    void saveCategory(@Param("category") Category category);

    Page<Category> list(@Param("name") String name, @Param("type") Integer type);
    @AutoFill(OperationType.UPDATE)
    void update(Category category);

    void deleteCategory(@Param("id") Long id);


    List<Category> getCategoryByType(@Param("type") Integer type);
}
